<%--
 - Copyright (c) 2009-2011 ETCORE Labs. All rights reserved. 
 - 
 - This software is the confidential and proprietary information of ETCORE Labs. 
 - You shall not disclose such confidential information and shall use it only
 - in accordance with the terms of the license agreement you entered into
 - with ETCORE Labs.
 -
 - Support can be obtained from support forums at:
 - http://www.etcore.com/
 -
 - @author: ETCORE GroupTalk developers
 -
 --%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c"%>
<%@ taglib uri="http://www.etcore.com/grouptalk" prefix="grouptalk"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="/group/css/styles.css" type="text/css">
<script>
function  showSubmenu(){
	var submenuFrame=document.getElementById("submenu"); 
	submenuFrame.style.display =  "" ;  

	
}
function  hideSubmenu(){
	var submenuFrame=document.getElementById("submenu"); 
	submenuFrame.style.display =  "none" ;  
	if(submenuFrame.contains(event.toElement))submenuFrame.style.display =  "block" ;  
 
	
}
 
function useLanguage(lang){
	if(lang!='0'){
	var url='/?lang='+lang;
	window.location.href=url;
	}
}
 
</script>

</head>
<body>

<%--
<div
	style="position: absolute; right: 100; top: 0%; width: 20; z-index: 7;"><select
	onchange="useLanguage(this.options[this.options.selectedIndex].value) ">

	<option value="0"><c:out value='${context.language }' /></option>
	<option value="en"><c:out value="${context.en}" /></option>
	<option value="local"><c:out value="${context.local}" /></option>
</select></div>
 --%>

<div
	style="position: absolute; right: 0%; top: 0%; width: 40px; z-index: 7;"
	onmouseover="showSubmenu()" onmouseout="hideSubmenu()">
<table cellspacing=2 border=0 align=right>
	<tr>
		<td align=right><img src="/group/images/star.gif"
			onmouseover="showSubmenu()" border=0 />
		<div id=submenu
			style="display: none; height: 300px; padding: 0px; border: 2px solid #C5B1D8; background-color: white; overflow-y: auto; overflow-x: hidden; z-index: 7;">
		<c:set var="currentPlatform" value="1" />
		<table border=0 align=center>
			<c:forEach begin="1" end="3" step="1">
				<c:set var="platform" value="platform${currentPlatform}" />
				<c:set var="currentGroups" value="rootGroups${currentPlatform}" />
				<c:set var="currentViewer" value="groupadmin" />
				<c:set var="posturl" value="" />
				<c:set var="imgurl" value="" />
				<c:set var="encryptedUrl" value="" />
				<c:set var="p" value='p${ currentPlatform}' />
				<c:if test="${currentPlatform==3 }">
					<c:set var="currentViewer" value="bookmarks" />
					<c:set var="imgurl" value="/group/images/bookmark.gif" />
				</c:if>
				<c:if test="${currentPlatform==1 }">
					<c:set var="currentViewer" value="news" />
					<c:set var="imgurl" value="/group/images/info.gif" />
				</c:if>
				<c:if test="${currentPlatform==2 }">
					<c:set var="currentViewer" value="community" />
					<c:set var="imgurl" value="/group/images/community.gif" />
				</c:if>
				<c:if test="${currentPlatform==4 }">
					<c:set var="currentViewer" value="reminders" />
				</c:if>
				<c:if test="${currentPlatform==0 }">
					<c:set var="posturl" value="?open=0" />
				</c:if>
				<c:if test="${currentPlatform==3 }">
					<c:set var="encryptedUrl" value="encryptedUrl${currentPlatform }" />
				</c:if>
				<c:if test="${currentPlatform==1 }">
					<c:set var="encryptedUrl" value="encryptedUrl${currentPlatform }" />
				</c:if>
				<c:if test="${currentPlatform==2 }">
					<c:set var="encryptedUrl" value="encryptedUrl${currentPlatform }" />
				</c:if>



				<c:if test="${context[p]}">

					<tr bgcolor="#f3f3f3">
						<td colspan=3 align=left><a
							<c:if test="${not empty param.target}"> target=_top </c:if>
							style="font-weight: bold"
							href="/group/<c:out value='${currentViewer}'/><c:out value='${context.postfix }'/><c:out value='${posturl}'/>"><c:out
							value='${context[platform]}' /></a></td>
					</tr>
					<c:set var="directories" value="directories${currentPlatform}" />
					<c:forEach var="directory" items="${requestScope[directories] }">
						<c:set var="colCount" value="0" />
						<tr>
							<td colspan=3 align=left>
							<table style="margin-left: -10px;">
								<tr>
									<td><img src="/group/images/minus.gif" border=0 /><img
										src="/group/images/dir.gif" border=0 /></td>
									<td><c:out value="${directory.name }" /></td>
								</tr>
							</table>
							</td>
						</tr>
						<c:set var="groups" value="${directory.id }groups" />
						<c:forEach var="group" items="${requestScope[groups]}">

							<c:if test="${colCount%3==0 }">
								<tr>
							</c:if>
							<td nowrap align=left><c:if
								test="${not empty group.pic&&fn:indexOf(group.pic,'upload')!=-1 }">
								<img src="/${group.pic}" width=12 border=0 />
							</c:if><c:if
								test="${empty group.pic||fn:indexOf(group.pic,'upload')==-1 }">
								<img src="${imgurl }" width=12 border=0
									<c:if test="${colCount%3==0 }">style="  margin-left: 25;" </c:if> />
							</c:if> <c:if test="${!context[encryptedUrl]}">
								<a <c:if test="${not empty param.target}"> target=_top </c:if>
									<c:if test="${currentGroup.id==group.id }">
								style="font-weight:bold;color:red;"
							</c:if>
									href="/group/<c:out value='${currentViewer}'/>View<c:out value='${context.postfix}'/>?gid=<c:out value='${group.id }'/>"><c:out
									value='${group.name }' /></a>
							</c:if> <c:if test="${context[encryptedUrl]}">
								<c:set var='urlFragmentStr' value='?gid=${group.id}' />
								<c:set var='urlFragment'
									value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
								<a <c:if test="${not empty param.target}"> target=_top </c:if>
									<c:if test="${currentGroup.id==group.id }">
								style="font-weight:bold;color:red;"
							</c:if>
									href="/group/<c:out value='${currentViewer}'/>View<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><c:out
									value='${group.name }' /></a>
							</c:if></td>
							<c:if test="${colCount%3==2 }">
								</tr>
							</c:if>
							<c:set var="colCount" value="${colCount+1 }" />
						</c:forEach>

					</c:forEach>
					<c:set var="colCount" value="0" />
					<c:forEach var="group" items="${requestScope[currentGroups]}">
						<c:if test="${colCount%3==0 }">
							<tr>
						</c:if>
						<td align=left nowrap><img src="<c:out value='${imgurl }' />"
							<c:if test="${colCount%3==0 }">style="  margin-left: 5;" </c:if>
							border=0 /><c:if test="${!context[encryptedUrl]}">
							<a <c:if test="${not empty param.target}"> target=_top </c:if>
								<c:if test="${currentGroup.id==group.id }">
							style="font-weight:bold;color:red;"
						</c:if>
								href="/group/<c:out value='${currentViewer}'/>View<c:out value='${context.postfix}'/>?gid=<c:out value='${group.id }'/>"><c:out
								value='${group.name }' /></a>
						</c:if> <c:if test="${context[encryptedUrl]}">
							<c:set var='urlFragmentStr' value='?gid=${group.id}' />
							<c:set var='urlFragment'
								value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
							<a <c:if test="${not empty param.target}"> target=_top </c:if>
								<c:if test="${currentGroup.id==group.id }">
							style="font-weight:bold;color:red;"
						 </c:if>
								href="/group/<c:out value='${currentViewer}'/>View<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><c:out
								value='${group.name }' /></a>
						</c:if></td>
						<c:if test="${colCount%3==2 }">
							</tr>
						</c:if>
						<c:set var="colCount" value="${colCount+1 }" />
					</c:forEach>
				</c:if>
				<c:set var="currentPlatform" value="${currentPlatform+1 }" />
			</c:forEach>

		</table>
		</div>
		</td>
	</tr>
</table>
</div>
</BODY>
</HTML>
